

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>Alerts 模块 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" />
    <link rel="next" title="Diskprediction 模块" href="../diskprediction/" />
    <link rel="prev" title="Ceph RESTful API" href="../ceph_api/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../">Ceph 管理器守护进程</a></li>
      <li class="breadcrumb-item active">Alerts 模块</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../_sources/mgr/alerts.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../">Ceph 管理器守护进程</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../administrator/">安装和配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../modules/">模块编程</a></li>
<li class="toctree-l2"><a class="reference internal" href="../orchestrator_modules/">编写 orchestrator 插件</a></li>
<li class="toctree-l2"><a class="reference internal" href="../dashboard/">仪表盘模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../ceph_api/">Ceph RESTful API</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Alerts 模块</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id1">启用</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id2">配置</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id3">命令</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../diskprediction/">DiskPrediction 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../localpool/">localpool 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../prometheus/">Prometheus 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../influx/">Influx 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../hello/">Hello 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../telegraf/">Telegraf 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../telemetry/">Telemetry 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../iostat/">Iostat 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../crash/">Crash 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../insights/">Insights 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../orchestrator/">Orchestrator 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../rook/">Rook 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../rgw/">RGW 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mds_autoscaler/">MDS Autoscaler 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nfs/">NFS 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../smb/">SMB module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../progress/">Progress 模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cli_api/">CLI API 命令模块</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="alerts">
<h1>Alerts 模块<a class="headerlink" href="#alerts" title="Permalink to this heading"></a></h1>
<p>The alerts module can send simple alert messages about cluster health
via e-mail.  In the future, it will support other notification methods
as well.</p>
<dl class="field-list simple">
<dt class="field-odd">note<span class="colon">:</span></dt>
<dd class="field-odd"><p>This module is <em>not</em> intended to be a robust monitoring
solution.  The fact that it is run as part of the Ceph cluster
itself is fundamentally limiting in that a failure of the
ceph-mgr daemon prevents alerts from being sent.  This module
can, however, be useful for standalone clusters that exist in
environments where existing monitoring infrastructure does not
exist.</p>
</dd>
</dl>
<section id="id1">
<h2>启用<a class="headerlink" href="#id1" title="Permalink to this heading"></a></h2>
<p>The <em>alerts</em> module is enabled with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">mgr</span> <span class="n">module</span> <span class="n">enable</span> <span class="n">alerts</span>
</pre></div>
</div>
</section>
<section id="id2">
<h2>配置<a class="headerlink" href="#id2" title="Permalink to this heading"></a></h2>
<p>To configure SMTP, all of the following config options must be set:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">config</span> <span class="nb">set</span> <span class="n">mgr</span> <span class="n">mgr</span><span class="o">/</span><span class="n">alerts</span><span class="o">/</span><span class="n">smtp_host</span> <span class="o">*&lt;</span><span class="n">smtp</span><span class="o">-</span><span class="n">server</span><span class="o">&gt;*</span>
<span class="n">ceph</span> <span class="n">config</span> <span class="nb">set</span> <span class="n">mgr</span> <span class="n">mgr</span><span class="o">/</span><span class="n">alerts</span><span class="o">/</span><span class="n">smtp_destination</span> <span class="o">*&lt;</span><span class="n">email</span><span class="o">-</span><span class="n">address</span><span class="o">-</span><span class="n">to</span><span class="o">-</span><span class="n">send</span><span class="o">-</span><span class="n">to</span><span class="o">&gt;*</span>
<span class="n">ceph</span> <span class="n">config</span> <span class="nb">set</span> <span class="n">mgr</span> <span class="n">mgr</span><span class="o">/</span><span class="n">alerts</span><span class="o">/</span><span class="n">smtp_sender</span> <span class="o">*&lt;</span><span class="n">from</span><span class="o">-</span><span class="n">email</span><span class="o">-</span><span class="n">address</span><span class="o">&gt;*</span>
</pre></div>
</div>
<p>By default, the module will use SSL and port 465.  To change that,:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">config</span> <span class="nb">set</span> <span class="n">mgr</span> <span class="n">mgr</span><span class="o">/</span><span class="n">alerts</span><span class="o">/</span><span class="n">smtp_ssl</span> <span class="n">false</span>   <span class="c1"># if not SSL</span>
<span class="n">ceph</span> <span class="n">config</span> <span class="nb">set</span> <span class="n">mgr</span> <span class="n">mgr</span><span class="o">/</span><span class="n">alerts</span><span class="o">/</span><span class="n">smtp_port</span> <span class="o">*&lt;</span><span class="n">port</span><span class="o">-</span><span class="n">number</span><span class="o">&gt;*</span>  <span class="c1"># if not 465</span>
</pre></div>
</div>
<p>To authenticate to the SMTP server, you must set the user and password:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">config</span> <span class="nb">set</span> <span class="n">mgr</span> <span class="n">mgr</span><span class="o">/</span><span class="n">alerts</span><span class="o">/</span><span class="n">smtp_user</span> <span class="o">*&lt;</span><span class="n">username</span><span class="o">&gt;*</span>
<span class="n">ceph</span> <span class="n">config</span> <span class="nb">set</span> <span class="n">mgr</span> <span class="n">mgr</span><span class="o">/</span><span class="n">alerts</span><span class="o">/</span><span class="n">smtp_password</span> <span class="o">*&lt;</span><span class="n">password</span><span class="o">&gt;*</span>
</pre></div>
</div>
<p>By default, the name in the <code class="docutils literal notranslate"><span class="pre">From:</span></code> line is simply <code class="docutils literal notranslate"><span class="pre">Ceph</span></code>.  To
change that (e.g., to identify which cluster this is),:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">config</span> <span class="nb">set</span> <span class="n">mgr</span> <span class="n">mgr</span><span class="o">/</span><span class="n">alerts</span><span class="o">/</span><span class="n">smtp_from_name</span> <span class="s1">&#39;Ceph Cluster Foo&#39;</span>
</pre></div>
</div>
<p>By default, the module will check the cluster health once per minute
and, if there is a change, send a message.  To change that
frequency,:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">config</span> <span class="nb">set</span> <span class="n">mgr</span> <span class="n">mgr</span><span class="o">/</span><span class="n">alerts</span><span class="o">/</span><span class="n">interval</span> <span class="o">*&lt;</span><span class="n">interval</span><span class="o">&gt;*</span>   <span class="c1"># e.g., &quot;5m&quot; for 5 minutes</span>
</pre></div>
</div>
</section>
<section id="id3">
<h2>命令<a class="headerlink" href="#id3" title="Permalink to this heading"></a></h2>
<p>To force an alert to be send immediately,:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">alerts</span> <span class="n">send</span>
</pre></div>
</div>
</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../ceph_api/" class="btn btn-neutral float-left" title="Ceph RESTful API" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../diskprediction/" class="btn btn-neutral float-right" title="Diskprediction 模块" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>